FROM alpine:latest

ARG TIME_ZONE=UTC

ENV LC_ALL=C.UTF-8

ENV TIME_ZONE=${TIME_ZONE}

RUN ln -snf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime ; \
  echo ${TIME_ZONE} > /etc/timezone ;

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories ;

RUN apk update ;

RUN apk add nodejs npm ;

RUN npm config set registry https://registry.npm.taobao.org ;

WORKDIR /usr/src/app

RUN npm install http-server

COPY _site /usr/src/app/_site

CMD node_modules/http-server/bin/http-server _site --cors -p 9100

EXPOSE 9100